<template>
	<view>
		<view class="title">
		    <view class="nowday u-f-ajc">
		        <text >{{day}}</text>
		    </view>
		    <view class="background">
		        <image src="../../static/day.jpg" mode="widthFix" />
		    </view>
		</view>
		<play-list :privileges="playList" :daysong="1"></play-list>
	</view>
</template>

<script>
	import playList from '../../components/playlist/play-list/play-list.vue';
	export default {
		components:{
			playList,
		},
		data() {
			return {
				day:0,
				playList:[],
				id:0,
			}
		},
		onLoad(){
			this.day=uni.getStorageSync("day");
			this.getdailySonge();
			/* this.Cookies=uni.getStorageSync("user") */
		},
		methods: {
			async getdailySonge(){
				const userinfo = uni.getStorageSync('userinfo')
				if(!userinfo){
					uni.showToast({
					  title: '请先登录',
					  icon: 'none',
					});
				}
				else{
					const result=await this.request({url: this.bsurl+'recommend/songs'});
					let playList=result.recommend.map(v=>{
					  return {
					    id:v.id,
					    name:v.name,
					    author:v.artists[0].name,
					    album:v.album.name,
					  }
					}) 
					this.playList=playList;
				}
			},
		}
	}
</script>

<style lang="less" scoped>
	.title{
	    position: relative;
		.nowday{
			position: absolute;
			top:50upx;
			left: 50upx;
			width: 100upx;
			height: 100upx;
			background-color: #ffffff;
			color: red;
			font-size: 46upx;
		}
		.background{
			image{
				width: 100%;
			}
		}
	}

</style>
